ALL_PACKAGE_CFLAGS = $(glib_CFLAGS) \
                     $(gtk2_CFLAGS) \
                     $(gconf_CFLAGS) \
                     $(libnotify_CFLAGS) \
                     $(libsoup_CFLAGS) \
                     $(libxml2_CFLAGS) \
                     $(libglade_CFLAGS) \
                     $(gstreamer_CFLAGS) \
                     $(gnome_keyring_CFLAGS)

ALL_PACKAGE_LIBS = $(glib_LIBS) \
                   $(gtk2_LIBS) \
                   $(gconf_LIBS) \
                   $(libnotify_LIBS) \
                   $(libsoup_LIBS) \
                   $(libxml2_LIBS) \
                   $(libglade_LIBS) \
                   $(gstreamer_LIBS) \
                   $(gnome_keyring_LIBS)

bin_PROGRAMS = gnome-gmail-notifier

INCLUDES = $(ALL_PACKAGE_CFLAGS) \
           -Wall

EXTRA_DIST = ggn-marshal.list

MARSHAL_GENERATED = ggn-marshal.c \
                    ggn-marshal.h

ggn-marshal.h: ggn-marshal.list
	( @GLIB_GENMARSHAL@ --prefix=ggn_marshal $(srcdir)/ggn-marshal.list --header > ggn-marshal.tmp \
	&& mv ggn-marshal.tmp ggn-marshal.h ) || ( rm -f ggn-marshal.tmp && exit 1 )

ggn-marshal.c: ggn-marshal.h
	( (echo '#include "ggn-marshal.h"'; @GLIB_GENMARSHAL@ --prefix=ggn_marshal $(srcdir)/ggn-marshal.list --body) > ggn-marshal.tmp \
	&& mv ggn-marshal.tmp ggn-marshal.c ) || ( rm -f ggn-marshal.tmp && exit 1 )

BUILT_SOURCES = $(MARSHAL_GENERATED)

CLEANFILES = $(MARSHAL_GENERATED)

gnome_gmail_notifier_SOURCES = main.c \
                               main.h \
                               $(MARSHAL_GENERATED) \
                               ggn-xml-parser.c \
                               ggn-xml-parser.h \
                               ggn-atom-feed.c \
                               ggn-atom-feed.h \
                               ggn-preferences.c \
                               ggn-preferences.h \
                               ggn-presence.c \
                               ggn-presence.h \
                               ggn-about-dialog.c \
                               ggn-about-dialog.h \
                               ggn-config.c \
                               ggn-config.h \
                               ggn-manager.c \
                               ggn-manager.h \
                               ggn-util.c \
                               ggn-util.h

gnome_gmail_notifier_LDADD = $(ALL_PACKAGE_LIBS)

AM_CPPFLAGS = $(ALL_PACKAGE_CFLAGS) \
			  -DPIXMAPS_DIR=\""$(pkgdatadir)"\" \
			  -DGLADEXML_DIR=\""$(pkgdatadir)"\" \
			  -DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\" \
			  -DGGN_LOCALEDIR=\""$(GGN_LOCALEDIR)"\"

again: clean all
